package com.surfilter.mq.rocketmq.timer;


import com.surfilter.mq.rocketmq.ConsumerManage;
import com.surfilter.mq.rocketmq.RocketMqConfig;
import com.surfilter.mq.rocketmq.cache.RockMqMesgManage;
import com.surfilter.mq.rocketmq.impl.OprateMessageBlockServiceCache;
import com.surfilter.mq.rocketmq.impl.OprateMessageServiceCache;

public class ConsumerCurrencyCommon {

	/**
	 * 每条消息对应的JAVA对象必须实现RocketMqMessageStandard接口才能使用此方法
	 * @param config
	 * @param manage
	 * @return
	 */
	public static boolean openConsumer(RocketMqConfig config, RockMqMesgManage manage){
		return ConsumerManage.openConsumerA(config, new OprateMessageServiceCache(manage));
	}
	
	/**
	 * 每条消息对应的JAVA对象必须实现RocketMqMessageStandard接口才能使用此方法
	 * @param config
	 * @param manage
	 * @return
	 */
	public static boolean openConsumerBlock(RocketMqConfig config, RockMqMesgManage manage){
		return ConsumerManage.openConsumerA(config, new OprateMessageBlockServiceCache(manage));
	}
	
}
